<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>

<body>
    <div class="J_calculator">
        <p>
            <input class="input" type="text" placeholder="第一个数字" />
            <input class="input" type="text" placeholder="第二个数字" />
        </p>
        <p>计算结果：<span class="result">0</span></p>
        <p>
            <button data-field="plus">+</button>
            <button data-field="minus">-</button>
            <button data-field="mul">*</button>
            <button data-field="div">/</button>
        </p>
    </div>
    <div class="J_calculator">
        <p>
            <input class="input" type="text" placeholder="第一个数字" />
            <input class="input" type="text" placeholder="第二个数字" />
        </p>
        <p>计算结果：<span class="result">0</span></p>
        <p>
            <button data-field="plus">+</button>
            <button data-field="minus">-</button>
            <button data-field="mul">*</button>
            <button data-field="div">/</button>
        </p>
    </div>

    <script src="./js/index.js"></script>
    <script>
        new Calculator(document.getElementsByClassName('J_calculator')[0])
        new Calculator(document.getElementsByClassName('J_calculator')[1])
    </script>
</body>

</html>